package com.xcf.server.config;


import com.xcf.center.server.IRegister;
import com.xcf.center.server.RegisterConfig;
import com.xcf.center.server.ZookeeperRegister;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GenerateRegisterConfig {

    @Bean
    @ConfigurationProperties(prefix = "register.config")
    public RegisterConfig config() {
        return new RegisterConfig();
    }

    @Bean
    public IRegister register(RegisterConfig registerConfig) {
        return new ZookeeperRegister(registerConfig);
    }
}
